#include <iostream>
using namespace std;
int main()
{
	for (int i=0; i<=9; i++)
	{
		int i_cube = i * i * i;//zheyang keyi jianshao i*i*i de jisuan cishu,you 10000ci biaowei 10ci.
		for (int j=0; j<=9; j++)
		{
			int j_cube = j * j * j;//zheyang keyi jianshao j*j*j de jisuan cishu,you 100ci biaowei 10ci.
			for (int k=0; k<=9; k++)
			{
				if (i_cube + j_cube + k*k*k != i*100 + j*10 +k)//gewei shuzi lifang dengyu gaishu benti de danweishu.
				{
					continue;
				}
				cout << i << j << k <<endl;
			}
		}
	}
	return 0;
} 
